/*
接口统一管理配置
*/
import config from '@/config/environment.js';
const  BASE_API=config.BASE_API;
const  multipartUrl=config.MULTIPART_API;
const install = (Vue, vm) => {
	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	const sys={
		login: (params = {}) => vm.$u.post(BASE_API+'sys/login', params),
		loginOut :  (params = {}) => vm.$u.post(BASE_API+'sys/logout', params),
		checkMobile:  (params = {}) => vm.$u.post(BASE_API+'sys/checkMobile', params),
		register: (params = {}) => vm.$u.post(BASE_API+'sys/register', params),
		saveWxUserInfo:(params = {}) => vm.$u.post(BASE_API+'saveWxUserInfo', params),
	}
	vm.$u.api = {sys,multipartUrl};
}



export default {
	install
}